package com.chilx.aop.controller;

import com.chilx.aop.annotation.LogAnnotation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author chilx
 * @date 2021/4/1
 **/
@RestController
@RequestMapping("/annotation")
public class AnnotationController {


    @GetMapping("/before")
    @LogAnnotation(title = "前置通知测试", remark = "这是一个前置通知")
    public void before(String name, String age) {
        System.out.println(name + " : " + age);
    }

    @GetMapping("/after")
    @LogAnnotation(title = "后置通知测试", remark = "这是一个后置通知")
    public void after(String name, String age) {
        System.out.println(name + " : " + age);
    }

    @GetMapping("/exception")
    @LogAnnotation(title = "异常通知测试", remark = "这是一个异常通知")
    public void exception(String name, String age) {
        System.out.println(name + " : " + age);
    }

    @GetMapping("/around")
    @LogAnnotation(title = "环绕通知测试", remark = "这是一个环绕通知")
    public void around(String name, String age) {
        System.out.println(name + " : " + age);
    }


}
